<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@include file="/include/public.jspf"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-base.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-common.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/p-all.css" />

<script type="text/javascript" src="${path }/js/jquery1.10.2.min.js"></script>
<script type="text/javascript" src="${path }/js/lib/zepto.js"></script>
<script type="text/javascript" src="${path }/js/common/base.js"></script>
<script type="text/javascript" src="${path }/js/lib/lib.js"></script>

<title>魔环金融</title>
</head>
<body>
<div class="ui_title">
        <a class="ui_back" href="javascript:void(0)" onclick="window.history.back();"><i class="ui_icon_back"></i>返回</a>
        持有资产</div>
    <section class="m-main p_load">
        <div class="ui_acc_money">
            <div class="money-list clearfix">
                <div class="money-l">
                    <div class="mo-tit">P2P总资产(元)</div>
                    <div class="mo-cont">0.00</div>
                </div>
                <div class="money-r">
                    <div class="mo-tit">累计收益(元)</div>
                    <div class="mo-cont">0.00</div>
                </div>
            </div>
            <div class="money-list clearfix">
                <div class="money-l">
                    <div class="mo-tit">待收收益(元)</div>
                    <div class="mo-cont">0.00</div>
                </div>
                <div class="money-r">
                    <div class="mo-tit">待收本金(元)</div>
                    <div class="mo-cont">0.00</div>
                </div>
            </div>
        </div>
        <div class="tab">
            <ul class="ui_tab_nav ui_tab_num4 mt10">
                <li class="select"><span>全部</span><em></em></li>
                <li><span>投资中</span><em></em></li>
                <li><span>还款中</span><em></em></li>
                <li><span>已还清</span><em></em></li>
            </ul>
            <div class="tab_bd">
                <!-- 全部 -->
                <div class="tab_con">
                    <div class="tab_box"></div>
                    <div class="ui_loadmore_text"><a href="javascript:void(0);">点击加载更多</a></div>
                </div>
                <!-- 投资中 -->
                <div class="tab_con" style="display:none;">
                    <div class="tab_box"></div>
                    <div class="ui_loadmore_text"><a href="javascript:void(0);">点击加载更多</a></div>
                </div>
                <!-- 还款中 -->
                <div class="tab_con" style="display:none;">
                    <div class="tab_box"></div>
                    <div class="ui_loadmore_text"><a href="javascript:void(0);">点击加载更多</a></div>
                </div>
                <!-- 已还清 -->
                <div class="tab_con" style="display:none;">
                    <div class="tab_box"></div>
                    <div class="ui_loadmore_text"><a href="javascript:void(0);">点击加载更多</a></div>
                </div>
            </div>
        </div>
    </section>
    
    <script>
    $(function(){
       var tabHash = {
           tab0 : new P2PWAP.ui.P2PLoadMore($(".tab .tab_box")[0], $('.tab .ui_loadmore_text')[0], '/account/ajax_load?status=0',1),
           tab1 : new P2PWAP.ui.P2PLoadMore($(".tab .tab_box")[1], $('.tab .ui_loadmore_text')[1], '/account/ajax_load?status=1%2C2',1),
           tab2 : new P2PWAP.ui.P2PLoadMore($(".tab .tab_box")[2], $('.tab .ui_loadmore_text')[2], '/account/ajax_load?status=4',1),
           tab3 : new P2PWAP.ui.P2PLoadMore($(".tab .tab_box")[3], $('.tab .ui_loadmore_text')[3], '/account/ajax_load?status=5',1)
       };
       tabHash.tab0.createItem = tabHash.tab1.createItem = tabHash.tab2.createItem = tabHash.tab3.createItem = function(item){
           var div = document.createElement("div");
           var html = '';
           html += '<a href="/account/load_detail?id=' + item.id + '">';
           if (item.deal_status == 1) html += '<div class="title"><span class="ui_arrow fr"></span><span class="ui_stutas">投资中</span>' + item.deal_name + '</div>';
           if (item.deal_status == 2) html += '<div class="title"><span class="ui_arrow fr"></span><span class="ui_stutas">满标</span>' + item.deal_name + '</div>';
           if (item.deal_status == 4) {
               if (item.deal_type == 1 && item.deal_compound_status == 2) {
                   html += '<div class="title"><span class="ui_arrow fr"></span><span class="ui_stutas">待赎回</span>' + item.deal_name + '</div>';
               } else {
                   html += '<div class="title"><span class="ui_arrow fr"></span><span class="ui_stutas">还款中</span>' + item.deal_name + '</div>';
               }
           } 
           if (item.deal_status == 5) html += '<div class="title"><span class="ui_arrow fr"></span><span class="ui_stutas">已还清</span>' + item.deal_name + '</div>';
           html += '    <div class="con">';
           html += '        <ul class="clearfix">';
           if (item.deal_type == 1) {
               if (item.deal_status == 1 || item.deal_status == 2 || (item.deal_status == '4' && item.deal_compound_status != 2)) {
                   html += '    <li><span class="f10">至今日收益：</span><span class="red_v1">' + ((item.deal_compound_day_interest > 0) ? item.deal_compound_day_interest : 0) + '元</span></li>';
                   html += '    <li><span class="f10">到期年化收益率：</span>' + item.deal_rate + '%起</li>';
                   html += '    <li><span class="f10">到账日：</span>' + ((item.compound_time == '' || item.compound_time == '-') ? '--' : item.compound_time) + '</li>';
               } else if (item.deal_status == '4' && item.deal_compound_status == 2) {
                   html += '    <li><span class="f10">预期收益：</span><span class="red_v1">' + item.income + '元</span></li>';
                   html += '    <li><span class="f10">到期年化收益率：</span>' + item.deal_rate + '%起</li>';
                   html += '    <li><span class="f10">到账日：</span>申请赎回后显示</li>';
               } else if(item.deal_status == '5') {
                   html += '    <li><span class="f10">已获收益：</span><span class="red_v1">' + item.real_income + '元</span></li>';
                   html += '    <li><span class="f10">年化收益率：</span>' + item.deal_rate + '%起</li>';
                   html += '    <li><span class="f10">预期收益：</span>' + item.income + '元</li>';
               }
           } else {
               html += '        <li><span class="f10">已获收益：</span><span class="red_v1">' + item.real_income + '元</span></li>';
               html += '        <li><span class="f10">年化收益率：</span>' + item.deal_rate + '%</li>';
               html += '        <li><span class="f10">预期收益：</span>' + item.income + '元</li>';
           }
           html += '            <li><span class="f10">计息日：</span>' + ((item.repay_start_time == '') ? '--' : item.repay_start_time) + '</li>';
           html += '            <li><span class="f10">投资金额：</span>' + item.deal_load_money + '元</li>';
           html += '            <li><span class="f10">收益方式：</span>' + item.loantype_name + '</li>';
           html += '            <li><span class="f10">投资期限：</span>' + item.repay_time + '</li>';
           html += '            <li><span class="f10">融资方：</span>' + item.user_deal_name + '</li>';
           html += '        </ul>';
           html += '    </div>';
           html += '</a>';
           div.innerHTML = html;
           div.className="load_list";
           return div;
       }
       var _getLoadFirstpage = [];
       tabHash.tab0.preloadPage(_getLoadFirstpage,1);
       $('.ui_tab_nav li').click(function() {
           if($(this).hasClass('select')) return;
           var idx = $(this).index();
           var $con = $('.tab .tab_con').eq(idx);
           $(this).addClass('select').siblings().removeClass('select');
           $con.show().siblings().hide();
           tabHash['tab' + idx].refresh();
        });
    });
    </script>
</body>
</html>